
/* + C O P Y R I G H T * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* See top source directory for COPYRIGHT.txt                              */
/* Copyright 2002-2003 by Mark Wolgemuth, All rights reserved.             */
/* Copyright 2002-2003 by Employease, Inc.  All rights reserved.           */
/* - C O P Y R I G H T * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include "athd.h"

athd_cmd_req *
athd_cmd_req_create(apr_pool_t *pool, athd_cmd_handler *handler)
{
    apr_pool_t *subpool;
    athd_cmd_req *req;
    apr_bucket *bk;
    apr_pool_create(&subpool, pool);
    req = apr_pcalloc(subpool, sizeof(athd_cmd_req));
    req->pool = subpool;
    req->handler = handler;
    req->ba_recv = apr_bucket_alloc_create(req->pool);
    req->bb_recv = apr_brigade_create(req->pool, req->ba_recv);
    bk = apr_bucket_socket_create(handler->socket, req->ba_recv);
    APR_BRIGADE_INSERT_TAIL(req->bb_recv, bk);
    req->ba_send = apr_bucket_alloc_create(req->pool);
    req->bb_send = apr_brigade_create(req->pool, req->ba_send);
    req->tosend = 0;
    req->recved = 0;
    return req;
}
